package com.hlbb.domain.bean;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CamasterId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CamasterId implements java.io.Serializable {

	// Fields

	private String accountnumber;
	private Integer currentstatementdate;

	// Constructors

	/** default constructor */
	public CamasterId() {
	}

	/** full constructor */
	public CamasterId(String accountnumber, Integer currentstatementdate) {
		this.accountnumber = accountnumber;
		this.currentstatementdate = currentstatementdate;
	}

	// Property accessors

	@Column(name = "ACCOUNTNUMBER", nullable = false, length = 19)
	public String getAccountnumber() {
		return this.accountnumber;
	}

	public void setAccountnumber(String accountnumber) {
		this.accountnumber = accountnumber;
	}

	@Column(name = "CURRENTSTATEMENTDATE", nullable = false, precision = 6, scale = 0)
	public Integer getCurrentstatementdate() {
		return this.currentstatementdate;
	}

	public void setCurrentstatementdate(Integer currentstatementdate) {
		this.currentstatementdate = currentstatementdate;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CamasterId))
			return false;
		CamasterId castOther = (CamasterId) other;

		return ((this.getAccountnumber() == castOther.getAccountnumber()) || (this
				.getAccountnumber() != null
				&& castOther.getAccountnumber() != null && this
				.getAccountnumber().equals(castOther.getAccountnumber())))
				&& ((this.getCurrentstatementdate() == castOther
						.getCurrentstatementdate()) || (this
						.getCurrentstatementdate() != null
						&& castOther.getCurrentstatementdate() != null && this
						.getCurrentstatementdate().equals(
								castOther.getCurrentstatementdate())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getAccountnumber() == null ? 0 : this.getAccountnumber()
						.hashCode());
		result = 37
				* result
				+ (getCurrentstatementdate() == null ? 0 : this
						.getCurrentstatementdate().hashCode());
		return result;
	}

}